package thread;

public class SyDemo3 {
    public static void main(String[] args) {
        Thread t1=new Thread(()->Boo.doSome());
        Thread t2=new Thread(()->Boo.doSome());
        t1.start();
        t2.start();
    }
}

class Boo
{
    public static void doSome()
    {
        synchronized (Boo.class) {
            try {
                Thread thread = Thread.currentThread();
                System.out.println(thread + "doing");
                Thread.sleep(1000);
                System.out.println(thread + "finish");
            } catch (InterruptedException e) {
            }
        }
    }
}
